#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("learn.in" , "r" , stdin);
	freopen("learn.out" , "w" , stdout);
	int n , a[1010];
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		cin >> a[i];
	}
	for(int i = 1 ; i <= n ; i++){
		int flag = 0 , num = 0 , min = 1000000;
		for(int j = 1 ; j <= n ; j++){
			if(a[j] > a[i]){
				if(flag == 0){
					min = a[j] , num = j;
					flag = 1;
				}
				if(flag == 1){
					if(a[j] < min){
						min = a[j];
						num = j;
					}
				}
			}
		}
		if(flag != 0){
			cout << num << endl;
		}
		else if(flag == 0){
			cout << "0" << endl;
		}
	}
	return 0;
}